<template>
<!-- 添加职位 -->
   <div>
        <el-row>
           <el-col :span="24">
                <div class="grid-content bg-purple-dark">
                    <el-steps :active="active"  :space="200" finish-status="success" style="position:relative;left:50px;top:40px;">
                    <el-step title="职位信息"></el-step>
                    <el-step title="职位设置"></el-step>
                    </el-steps>
                    <br/><br/><br/><br/>
                    <div v-if="active==0">
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >职位信息</span>
                        <!-- <div class="xian"></div> -->
                        <el-form :inline="true" label-width="150px" :model="formInline" class="demo-form-inline" style="margin-top: 40px;">
                        <el-form-item label="职位名称">
                            <el-input v-model="formInline.tposition.positionName" placeholder="请输入" style="width:400px"></el-input>
                        </el-form-item>
                        <el-form-item label="招聘人数">
                            <el-input v-model="formInline.recruitingNumbers" placeholder="请输入" style="width:400px"></el-input>
                        </el-form-item>
                         <el-form-item label="职位性质">
                            <el-select v-model="formInline.tposition.postType" placeholder="职位性质" style="width:400px">
                            <el-option label="全职" value="0"></el-option>
                            <el-option label="兼职" value="1"></el-option>
                            <el-option label="实习" value="2"></el-option>
                            <el-option label="外派" value="3"></el-option>
                            <el-option label="退休返聘" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="用人部门">
                            <el-select v-model="formInline.tposition.deptName" placeholder="请选择" style="width:400px">
                            <el-option
                                v-for="item in options1"
                                :key="item.deptName"
                                :label="item.deptName"
                                :value="item.deptName">
                            </el-option>
                            </el-select>
                        </el-form-item>
                         <el-form-item label="工作地点">
                            <el-input v-model="formInline.workplace" placeholder="请输入" style="width:400px"></el-input>
                        </el-form-item>
                        <el-form-item label="详细地址">
                            <el-input v-model="formInline.address" placeholder="请输入" style="width:400px"></el-input>
                        </el-form-item>
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >招聘要求</span>
                        <br/><br/><br/>
                        <el-form-item label="薪资范围">
                            <el-input v-model="formInline.salaryRange" placeholder="请输入" style="width:110px"></el-input> -
                            <el-input v-model="formInline.salaryRangeTwo" placeholder="请输入" style="width:110px"></el-input>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <el-input v-model="formInline.salaryMonth" placeholder="请输入" style="width:110px"></el-input>薪
                        </el-form-item>
                        <el-form-item label="学历要求">
                            <el-select v-model="formInline.educational" placeholder="请选择" style="width:400px">
                            <el-option label="不限" value="0"></el-option>
                            <el-option label="高中及一下" value="1"></el-option>
                            <el-option label="大专" value="2"></el-option>
                            <el-option label="本科" value="3"></el-option>
                            <el-option label="硕士" value="4"></el-option>
                            <el-option label="博士及以上" value="5"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="工作经验">
                            <el-select v-model="formInline.workExperience" placeholder="请选择" style="width:400px">
                            <el-option label="不限" value="0"></el-option>
                            <el-option label="1-3年" value="1"></el-option>
                            <el-option label="3-5年" value="2"></el-option>
                            <el-option label="5-10年" value="3"></el-option>
                            <el-option label="10年以上" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="专业">
                            <el-input v-model="formInline.major" placeholder="请输入" style="width:400px"></el-input>
                        </el-form-item>
                         <el-form-item label="职位表述">
                            <quill-editor
                            ref="myQuillEditor"
                            v-model="formInline.occupation"
                            :options="editorOption"
                            @blur="onEditorBlur($event)"
                            @focus="onEditorFocus($event)"
                            @ready="onEditorReady($event)"
                            style="height:150px;width:960px"
                            />
                         </el-form-item>
                        </el-form>
                    </div>
                    <div v-if="active==1">
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >招聘信息</span>
                        <el-form :inline="true"  label-width="160px" :model="formInline" class="demo-form-inline" style="margin-top: 40px;">
                            <el-form-item label="计划启动日期">
                                <el-date-picker
                                value-format="yyyy-MM-dd"
                                v-model="formInline.startupDate"
                                type="date"
                                placeholder="选择日期">
                                </el-date-picker>
                            </el-form-item>
                            <br/>
                            <el-form-item label="最晚到岗日期">
                                <el-date-picker
                                value-format="yyyy-MM-dd"
                                v-model="formInline.latestDate"
                                type="date"
                                placeholder="选择日期">
                                </el-date-picker>
                            </el-form-item>
                            <br/>
                            <el-form-item label="招聘负责人">
                                <!-- 选择抄送人start -->

                                    <div class="avatar-uploader">
                                        <!-- 选中负责人后展示start -->
                                        <div v-if="selectedUser != ''">
                                            <img :src="selectedUser.icon" class="avatar" @click="headPage = true">
                                            <span style="position: relative;top: -17px;left: 20px;">{{selectedUser.nickName }}
                                                <span style="margin-left: 26px;cursor: pointer;"
                                                    @click="deUser">X</span>
                                            </span>
                                        </div>
                                        <!-- 选中抄送人后展示end -->
                                        <!-- 负责人未选中展示 -->
                                        <i v-else @click="headPage = true" class="el-icon-plus avatar-uploader-icon"></i>
                                    </div>
                                    <el-dialog v-loading="loading" element-loading-text="拼命加载中"
                                        element-loading-spinner="el-icon-loading"
                                        element-loading-background="rgba(0, 0, 0, 0.8)" :visible.sync="headPage"
                                        width="50%" :show-close="false">
                                        <el-breadcrumb separator-class="el-icon-arrow-right">
                                            <!-- 步骤条start -->
                                            <el-breadcrumb-item v-for="(value, index) in headNavs" :key="index"
                                                @click="upNav(index)">
                                                <el-button v-if="persons.id == undefined" size="mini" style="border: 0px;"
                                                    @click="upNav(index)">{{ value }}</el-button>
                                            </el-breadcrumb-item>
                                            <!-- 步骤条end -->
                                            <br>
                                            <br>
                                            <br>
                                            <!-- 展示右边所选中的用户start -->
                                            <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                已选择<span v-if="selectedUser != ''">1</span><span v-else>0</span>位联系人
                                                <br>
                                                <br>
                                                <br>
                                            </div>
                                            <!-- 展示选中的用户 -->
                                            <div v-if="selectedUser != ''" class="architecture"
                                                style="height: 50px;float: right;    position: relative;top: 12px;right: 50px;">
                                                <img style="width: 30px;height: 30px;position: relative;top: 10px;"
                                                    :src="selectedUser.icon" />
                                                <span
                                                    style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                    {{ selectedUser.nickName }}<br><br>
                                                    {{ selectedUser.tposition.deptName }}
                                                    <span
                                                        style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;"
                                                        @click="deUser">X</span>
                                                </span>

                                            </div>
                                            <!-- 展示右边所选中的用户end -->
                                            <!-- 展示左边信息start -->
                                            <!-- 展示部门和人数start -->
                                            <div class="architecture" style="line-height: 39px;"
                                                v-for="(value, perIndex) in persons" :key="perIndex"
                                                @click="selectArchitecture(value.deptName)">
                                                <div class="log">
                                                    <img
                                                        src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                </div>
                                                <span style="margin-left: 5%;color: black;">
                                                    {{ value.deptName }}
                                                </span>
                                                &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                <span style="float: right;margin-right: 20px;">
                                                    ＞
                                                </span>
                                            </div>
                                            <!-- 展示部门和人数end -->
                                            <br>
                                            <!-- 展示当前所选部门的所有用户start -->
                                            <div v-if="users.length != 0">
                                                <div :class="[selectArchitectureCss != userIndex ? 'architecture' : '', selectArchitectureCss == userIndex ? 'architectureActe' : '']"
                                                    style="height: 50px;" v-for="(myUser, userIndex) in users"
                                                    :key="userIndex" @click="selectUser(userIndex)">
                                                    <el-radio style="width: 80%;height: 100%;" v-model="selectId"
                                                        :label="userIndex">
                                                        &nbsp;&nbsp;&nbsp;
                                                        <img style="width: 30px;height: 30px;position: relative;top: 10px;"
                                                            :src="myUser.icon" />
                                                        <span
                                                            style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                            {{ myUser.nickName }}<br><br>
                                                            {{ myUser.tposition.deptName }}
                                                        </span>

                                                    </el-radio>
                                                    <span>
                                                        ＞
                                                    </span>
                                                </div>
                                            </div>
                                            <!-- 展示当前所选部门的所有用户start -->
                                            <!-- 展示左边信息end -->

                                        </el-breadcrumb>

                                        <!-- 竖直分割线 -->
                                        <div class="myHr"></div>


                                        <span slot="footer" class="dialog-footer">
                                            <el-button @click="headPage = false">取 消</el-button>
                                            <el-button type="primary" @click="headPage = false">确 定</el-button>
                                        </span>
                                    </el-dialog>
                                    <!-- 选择负责人end -->
                            </el-form-item>
                            <br/>
                            <el-form-item label="用人经理">
                                       <div class="avatar-uploader">
                                <!-- 选中负责人后展示start -->
                                            <div v-if="selectedUser2!=''" >
                                                <img  :src="selectedUser2.icon" class="avatar" @click="headPage2=true">
                                                <span style="position: relative;top: -17px;left: 20px;">{{ selectedUser2.nickName }}
                                                    <span style="margin-left: 26px;cursor: pointer;" @click="deUser2">X</span>
                                                </span>
                                            </div>
                                            <!-- 选中抄送人后展示end -->
                                            <!-- 负责人未选中展示 -->
                                            <i v-else @click="headPage2=true" class="el-icon-plus avatar-uploader-icon"></i>
                                       </div>
                                        <el-dialog
                                            v-loading="loading"
                                            element-loading-text="拼命加载中"
                                            element-loading-spinner="el-icon-loading"
                                            element-loading-background="rgba(0, 0, 0, 0.8)"
                                            :visible.sync="headPage2"
                                            width="50%"
                                            :show-close="false">
                                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                                <!-- 步骤条start -->
                                                <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index" @click="upNav(index)">
                                                    <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upNav(index)">{{ value }}</el-button>
                                                </el-breadcrumb-item>
                                                <!-- 步骤条end -->
                                                <br>
                                                <br>
                                                <br>
                                                <!-- 展示右边所选中的用户start -->
                                                <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                    已选择<span v-if="selectedUser2!=''">1</span><span v-else>0</span>位联系人
                                                    <br>
                                                    <br>
                                                    <br>
                                                </div>
                                                <!-- 展示选中的用户 -->
                                                <div  v-if="selectedUser2!=''" class="architecture" style="height: 50px;float: right;    position: relative;top: 12px;right: 50px;">
                                                    <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="selectedUser2.icon"/>
                                                    <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                        {{ selectedUser2.nickName }}<br><br>
                                                        {{ selectedUser2.tposition.deptName }}
                                                        <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="deUser2">X</span>
                                                    </span>
                                                    
                                                </div>
                                                <!-- 展示右边所选中的用户end -->
                                                <!-- 展示左边信息start -->
                                                <!-- 展示部门和人数start -->
                                                <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                    <div class="log">
                                                        <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                    </div>
                                                    <span style="margin-left: 5%;color: black;">
                                                        {{ value.deptName }}
                                                    </span>
                                                    &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                    <span style="float: right;margin-right: 20px;">
                                                        ＞
                                                    </span>
                                                </div>
                                                <!-- 展示部门和人数end -->
                                                <br>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <div v-if="users.length!=0">
                                                    <div :class="[selectArchitectureCss != userIndex ?'architecture': '',selectArchitectureCss == userIndex ? 'architectureActe':'']" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex" @click="selectUser2(userIndex)">
                                                        <el-radio style="width: 80%;height: 100%;" v-model="selectId" :label="userIndex">
                                                            &nbsp;&nbsp;&nbsp;
                                                            <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                            <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                                {{ myUser.nickName }}<br><br>
                                                                {{ myUser.tposition.deptName }}
                                                            </span>
                                                            
                                                        </el-radio>
                                                        <span>
                                                                ＞
                                                        </span>
                                                    </div>
                                                </div>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <!-- 展示左边信息end -->
                                                
                                            </el-breadcrumb>

                                            <!-- 竖直分割线 -->
                                            <div class="myHr"></div>
                                            
                                            
                                            <span slot="footer" class="dialog-footer">
                                                <el-button @click="headPage2 = false">取 消</el-button>
                                                <el-button type="primary" @click="headPage2 = false">确 定</el-button>
                                            </span>
                                        </el-dialog>
                                    <!-- 选择负责人end -->
                            </el-form-item>
                            <br/>
                            <el-form-item label="简历初筛人">
                                        <div class="avatar-uploader">
                                <!-- 选中负责人后展示start -->
                                        <div v-if="selectedUser3!=''" >
                                                <img  :src="selectedUser3.icon" class="avatar" @click="headPage3=true">
                                                <span style="position: relative;top: -17px;left: 20px;">{{ selectedUser3.nickName }}
                                                    <span style="margin-left: 26px;cursor: pointer;" @click="deUser3">X</span>
                                                </span>
                                            </div>
                                            <!-- 选中抄送人后展示end -->
                                            <!-- 负责人未选中展示 -->
                                            <i v-else @click="headPage3=true" class="el-icon-plus avatar-uploader-icon"></i>
                                        </div>
                                        <el-dialog
                                            v-loading="loading"
                                            element-loading-text="拼命加载中"
                                            element-loading-spinner="el-icon-loading"
                                            element-loading-background="rgba(0, 0, 0, 0.8)"
                                            :visible.sync="headPage3"
                                            width="50%"
                                            :show-close="false">
                                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                                <!-- 步骤条start -->
                                                <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index" @click="upNav(index)">
                                                    <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upNav(index)">{{ value }}</el-button>
                                                </el-breadcrumb-item>
                                                <!-- 步骤条end -->
                                                <br>
                                                <br>
                                                <br>
                                                <!-- 展示右边所选中的用户start -->
                                                <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                    已选择<span v-if="selectedUser3!=''">1</span><span v-else>0</span>位联系人
                                                    <br>
                                                    <br>
                                                    <br>
                                                </div>
                                                <!-- 展示选中的用户 -->
                                                <div  v-if="selectedUser3!=''" class="architecture" style="height: 50px;float: right;    position: relative;top: 12px;right: 50px;">
                                                    <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="selectedUser3.icon"/>
                                                    <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                        {{ selectedUser3.nickName }}<br><br>
                                                        {{ selectedUser3.tposition.deptName }}
                                                        <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="deUser3">X</span>
                                                    </span>
                                                    
                                                </div>
                                                <!-- 展示右边所选中的用户end -->
                                                <!-- 展示左边信息start -->
                                                <!-- 展示部门和人数start -->
                                                <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                    <div class="log">
                                                        <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                    </div>
                                                    <span style="margin-left: 5%;color: black;">
                                                        {{ value.deptName }}
                                                    </span>
                                                    &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                    <span style="float: right;margin-right: 20px;">
                                                        ＞
                                                    </span>
                                                </div>
                                                <!-- 展示部门和人数end -->
                                                <br>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <div v-if="users.length!=0">
                                                    <div :class="[selectArchitectureCss != userIndex ?'architecture': '',selectArchitectureCss == userIndex ? 'architectureActe':'']" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex" @click="selectUser3(userIndex)">
                                                        <el-radio style="width: 80%;height: 100%;" v-model="selectId" :label="userIndex">
                                                            &nbsp;&nbsp;&nbsp;
                                                            <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                            <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                                {{ myUser.nickName }}<br><br>
                                                                {{ myUser.tposition.deptName }}
                                                            </span>
                                                            
                                                        </el-radio>
                                                        <span>
                                                                ＞
                                                        </span>
                                                    </div>
                                                </div>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <!-- 展示左边信息end -->
                                                
                                            </el-breadcrumb>

                                            <!-- 竖直分割线 -->
                                            <div class="myHr"></div>
                                            
                                            
                                            <span slot="footer" class="dialog-footer">
                                                <el-button @click="headPage3 = false">取 消</el-button>
                                                <el-button type="primary" @click="headPage3 = false">确 定</el-button>
                                            </span>
                                        </el-dialog>
                                    <!-- 选择负责人end -->
                            </el-form-item>
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >面试轮次</span>
                        <br/><br/><br/>
                        <el-form-item label="第一轮面试官">
                                       <div class="avatar-uploader">
                            <!-- 选中负责人后展示start -->
                                            <div v-if="selectedUser4!=''" >
                                                <img  :src="selectedUser4.icon" class="avatar" @click="headPage4=true">
                                                <span style="position: relative;top: -17px;left: 20px;">{{ selectedUser4.nickName }}
                                                    <span style="margin-left: 26px;cursor: pointer;" @click="deUser4">X</span>
                                                </span>
                                            </div>
                                            <!-- 选中抄送人后展示end -->
                                            <!-- 负责人未选中展示 -->
                                            <i v-else @click="headPage4=true" class="el-icon-plus avatar-uploader-icon"></i>
                                       </div>
                                        <el-dialog
                                            v-loading="loading"
                                            element-loading-text="拼命加载中"
                                            element-loading-spinner="el-icon-loading"
                                            element-loading-background="rgba(0, 0, 0, 0.8)"
                                            :visible.sync="headPage4"
                                            width="50%"
                                            :show-close="false">
                                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                                <!-- 步骤条start -->
                                                <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index" @click="upNav(index)">
                                                    <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upNav(index)">{{ value }}</el-button>
                                                </el-breadcrumb-item>
                                                <!-- 步骤条end -->
                                                <br>
                                                <br>
                                                <br>
                                                <!-- 展示右边所选中的用户start -->
                                                <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                    已选择<span v-if="selectedUser4!=''">1</span><span v-else>0</span>位联系人
                                                    <br>
                                                    <br>
                                                    <br>
                                                </div>
                                                <!-- 展示选中的用户 -->
                                                <div  v-if="selectedUser4!=''" class="architecture" style="height: 50px;float: right;    position: relative;top: 12px;right: 50px;">
                                                    <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="selectedUser4.icon"/>
                                                    <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                        {{ selectedUser4.nickName }}<br><br>
                                                        {{ selectedUser4.tposition.deptName }}
                                                        <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="deUser4">X</span>
                                                    </span>
                                                    
                                                </div>
                                                <!-- 展示右边所选中的用户end -->
                                                <!-- 展示左边信息start -->
                                                <!-- 展示部门和人数start -->
                                                <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                    <div class="log">
                                                        <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                    </div>
                                                    <span style="margin-left: 5%;color: black;">
                                                        {{ value.deptName }}
                                                    </span>
                                                    &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                    <span style="float: right;margin-right: 20px;">
                                                        ＞
                                                    </span>
                                                </div>
                                                <!-- 展示部门和人数end -->
                                                <br>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <div v-if="users.length!=0">
                                                    <div :class="[selectArchitectureCss != userIndex ?'architecture': '',selectArchitectureCss == userIndex ? 'architectureActe':'']" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex" @click="selectUser4(userIndex)">
                                                        <el-radio style="width: 80%;height: 100%;" v-model="selectId" :label="userIndex">
                                                            &nbsp;&nbsp;&nbsp;
                                                            <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                            <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                                {{ myUser.nickName }}<br><br>
                                                                {{ myUser.tposition.deptName }}
                                                            </span>
                                                            
                                                        </el-radio>
                                                        <span>
                                                                ＞
                                                        </span>
                                                    </div>
                                                </div>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <!-- 展示左边信息end -->
                                                
                                            </el-breadcrumb>

                                            <!-- 竖直分割线 -->
                                            <div class="myHr"></div>
                                            
                                            
                                            <span slot="footer" class="dialog-footer">
                                                <el-button @click="headPage4 = false">取 消</el-button>
                                                <el-button type="primary" @click="headPage4 = false">确 定</el-button>
                                            </span>
                                        </el-dialog>
                                    <!-- 选择负责人end -->
                        </el-form-item>
                        <el-form-item label="会议室">
                            <el-select v-model="tinterviewRoundPO.conferenceRoom1" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <br/><br/>
                        <el-form-item label="第二轮面试官">
                             <div class="avatar-uploader">
                            <!-- 选中负责人后展示start -->
                                            <div v-if="selectedUser5!=''" >
                                                <img  :src="selectedUser5.icon" class="avatar" @click="headPage5=true">
                                                <span style="position: relative;top: -17px;left: 20px;">{{ selectedUser5.nickName }}
                                                    <span style="margin-left: 26px;cursor: pointer;" @click="deUser5">X</span>
                                                </span>
                                            </div>
                                            <!-- 选中抄送人后展示end -->
                                            <!-- 负责人未选中展示 -->
                                            <i v-else @click="headPage5=true" class="el-icon-plus avatar-uploader-icon"></i>
                                       </div>
                                        <el-dialog
                                            v-loading="loading"
                                            element-loading-text="拼命加载中"
                                            element-loading-spinner="el-icon-loading"
                                            element-loading-background="rgba(0, 0, 0, 0.8)"
                                            :visible.sync="headPage5"
                                            width="50%"
                                            :show-close="false">
                                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                                <!-- 步骤条start -->
                                                <el-breadcrumb-item  v-for="(value,index) in headNavs" :key="index" @click="upNav(index)">
                                                    <el-button v-if="persons.id==undefined" size="mini" style="border: 0px;" @click="upNav(index)">{{ value }}</el-button>
                                                </el-breadcrumb-item>
                                                <!-- 步骤条end -->
                                                <br>
                                                <br>
                                                <br>
                                                <!-- 展示右边所选中的用户start -->
                                                <div style="float: right;margin-top: -70px;margin-right:30%;color: black;">
                                                    已选择<span v-if="selectedUser5!=''">1</span><span v-else>0</span>位联系人
                                                    <br>
                                                    <br>
                                                    <br>
                                                </div>
                                                <!-- 展示选中的用户 -->
                                                <div  v-if="selectedUser5!=''" class="architecture" style="height: 50px;float: right;    position: relative;top: 12px;right: 50px;">
                                                    <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="selectedUser5.icon"/>
                                                    <span style="margin-left: 17%;color: black;color: black;font-size: 10px;display: block;margin-top: -20px;">
                                                        {{ selectedUser5.nickName }}<br><br>
                                                        {{ selectedUser5.tposition.deptName }}
                                                        <span style="float: right;margin-top: -10px;margin-right: 20px;cursor: pointer;" @click="deUser5">X</span>
                                                    </span>
                                                    
                                                </div>
                                                <!-- 展示右边所选中的用户end -->
                                                <!-- 展示左边信息start -->
                                                <!-- 展示部门和人数start -->
                                                <div class="architecture" style="line-height: 39px;" v-for="(value,perIndex) in persons" :key="perIndex" @click="selectArchitecture(value.deptName)">
                                                    <div class="log">
                                                        <img src="https://cdn7.axureshop.com/demo2023/2236859/images/%E8%AF%B7%E5%81%87/u2303.svg" />
                                                    </div>
                                                    <span style="margin-left: 5%;color: black;">
                                                        {{ value.deptName }}
                                                    </span>
                                                    &nbsp;&nbsp;&nbsp;({{ value.deptCount }})
                                                    <span style="float: right;margin-right: 20px;">
                                                        ＞
                                                    </span>
                                                </div>
                                                <!-- 展示部门和人数end -->
                                                <br>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <div v-if="users.length!=0">
                                                    <div :class="[selectArchitectureCss != userIndex ?'architecture': '',selectArchitectureCss == userIndex ? 'architectureActe':'']" style="height: 50px;"  v-for="(myUser,userIndex) in users" :key="userIndex" @click="selectUser5(userIndex)">
                                                        <el-radio style="width: 80%;height: 100%;" v-model="selectId" :label="userIndex">
                                                            &nbsp;&nbsp;&nbsp;
                                                            <img style="width: 30px;height: 30px;position: relative;top: 10px;" :src="myUser.icon"/>
                                                            <span style="margin-left: 5%;color: black;font-size: 10px;float: left;position: relative;top: 12px;left: 110px;">
                                                                {{ myUser.nickName }}<br><br>
                                                                {{ myUser.tposition.deptName }}
                                                            </span>
                                                            
                                                        </el-radio>
                                                        <span>
                                                                ＞
                                                        </span>
                                                    </div>
                                                </div>
                                                <!-- 展示当前所选部门的所有用户start -->
                                                <!-- 展示左边信息end -->
                                                
                                            </el-breadcrumb>

                                            <!-- 竖直分割线 -->
                                            <div class="myHr"></div>
                                            
                                            
                                            <span slot="footer" class="dialog-footer">
                                                <el-button @click="headPage5 = false">取 消</el-button>
                                                <el-button type="primary" @click="headPage5 = false">确 定</el-button>
                                            </span>
                                        </el-dialog>
                                    <!-- 选择负责人end -->
                        </el-form-item>
                        <el-form-item label="会议室">
                            <el-select v-model="tinterviewRoundPO.conferenceRoom2" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <div class="kuang"></div>
                        <span style=" padding-left:40px;" >简历通过标准</span>
                        <br/><br/><br/>
                        <el-form-item label="性别">
                            <el-select v-model="formInline.sex" placeholder="请选择" style="width:400px">
                            <el-option label="不限" value="0"></el-option>
                            <el-option label="男" value="1"></el-option>
                            <el-option label="女" value="2"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学历要求">
                            <el-select v-model="formInline.educational" placeholder="请选择" style="width:400px">
                            <el-option label="不限" value="0"></el-option>
                            <el-option label="高中及一下" value="1"></el-option>
                            <el-option label="大专" value="2"></el-option>
                            <el-option label="本科" value="3"></el-option>
                            <el-option label="硕士" value="4"></el-option>
                            <el-option label="博士及以上" value="5"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="工作经验">
                            <el-select v-model="formInline.workExperience" placeholder="请选择" style="width:400px">
                            <el-option label="不限" value="0"></el-option>
                            <el-option label="1-3年" value="1"></el-option>
                            <el-option label="3-5年" value="2"></el-option>
                            <el-option label="5-10年" value="3"></el-option>
                            <el-option label="10年以上" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="年龄">
                            <el-select v-model="formInline.age" placeholder="请选择" style="width:400px">
                            <el-option label="不限" value="0"></el-option>
                            <el-option label="18-25" value="1"></el-option>
                            <el-option label="25-30" value="2"></el-option>
                            <el-option label="30-35" value="3"></el-option>
                            <el-option label="35-40" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                        </el-form>
                    </div>
                    
                    
                    <el-button v-if="active==0" style="margin-top: 120px;margin-left:1000px;" @click="PositionManagement">取消</el-button>
                    <el-button v-if="active==0" type="primary" style="margin-top: 12px;" @click="next">下一步</el-button>
                    <el-button v-if="active==1" style="margin-top: 30px;margin-left:1000px;" @click="shang">上一步</el-button>
                    <el-button v-if="active==1" type="primary" @click="onSubmit">提交</el-button>
                </div>
            </el-col>
        </el-row>
   </div>
</template>

<script>
import axios from 'axios'

import { quillEditor } from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";

export default {
    components:{
        quillEditor
    },
    data(){
        return{
            formInline:{
                id:"",
                status:"1",
                recruitingNumbers:"",
                workplace:"",
                address:"",
                salaryRange:"",
                salaryRangeTwo:"",
                salaryMonth:"",
                educational:"",
                workExperience:"",
                major:"",
                occupation:"",
                startupDate:"",
                latestDate:"",
                principal:"", //招聘负责人
                manager:"",  //用人经理
                preliminary:"", //简历初筛人员
                tinterview:[],
                tposition:{
                   positionName:"",
                   postType:"",
                   deptName:"",
                },
                
            },
            tinterviewRoundPO:{
                interviewer1:"",
                conferenceRoom1:"",
                interviewer2:"",
                conferenceRoom2:"",
            },
            options: [{
            value: '1',
            label: '会议室1'
            }, {
            value: '2',
            label: '会议室2'
            }, {
            value: '3',
            label: '会议室3'
            }, {
            value: '4',
            label: '会议室4'
            }, {
            value: '5',
            label: '会议室5'
            }],
            active: 0,
            options1:[],
            // 获取抄送人start
            headPage: false,//开启选择抄送人页面
            headPage2:false,
            headPage3:false,
            headPage4:false,//第一轮面试官
            headPage5:false,//第二轮面试官
            headNavs: ["组织架构"],//步骤条
            persons: [],//部门和部门人数
            users: [],//所选部门的人员
            loading: false,//加载开启和关闭
            selectArchitectureCss: -1,//选中指定行后开启指定的css
            selectId: -1,//单选框
            selectedUser: "",//选中的用户
            selectedUser2:"",//选中的用户
            selectedUser3:"",//选中的用户
            selectedUser4:"",//选中的用户
            selectedUser5:"",//选中的用户
            //  获取抄送人end
            // 富文本
            editorOption: {
                modules: {
                toolbar: [
                [
                    "bold",
                    "italic",
                    "underline",
                    "strike",
                    "link",
                    "image",
                    "code-block",
                ], // toggled buttons  
                    [{ 'align': [] }],    //对齐方式
                    [{ 'header': [1, 2, 3, 4, 5, 6, false] }],     //几级标题
                    [{ 'font': [] }],     //字体 
                    [{ 'size': ['small', 'normal', 'large', 'huge'] }],
                [{ 'color': [] }, { 'background': [] }],     // 字体颜色，字体背景颜色 
                    ],
                },
            },
        }
    },
    created(){
    if(this.$route.query.id!="" && this.$route.query.id!=undefined){
       this.findById();
    }
     this.getHolidayType();
     this.getDept();//获取部门
     
    },
    methods: {
        next() {
        this.active++ 
       },
       shang(){
         this.active--
       },
       PositionManagement(){
        this.$router.push("/PositionManagement"); //取消
      },
       getHolidayType() {
            axios.post("ReplacementCard/findDept")
                .then((res) => {
                    console.log(res);
                    this.options1 = res.data.rows;
                })
       },
        //添加
        onSubmit(){
        if(this.formInline.id==""){
            this .formInline.tinterview = []
            var tinterview1="";
            var tinterview2="";
            tinterview1=this.tinterviewRoundPO.interviewer1+","+this.tinterviewRoundPO.conferenceRoom1
            tinterview2=this.tinterviewRoundPO.interviewer2+","+this.tinterviewRoundPO.conferenceRoom2
            this.formInline.tinterview.push(tinterview1);
            this.formInline.tinterview.push(tinterview2);
            console.log(this.formInline);
            axios
            .post("TPositionMessage/addPositionMessage", this.formInline)
            .then((res) => {
                if (res.data.code == 200) {
                this.$message({
                    message: "恭喜你，" + res.data.msg,
                    type: "success",
                    
                });
                this.resetQuery();
                this.$router.push("/PositionManagement")
                } else {
                this.$message.error("错了哦，" + res.data.msg);
                }
            });
        }else{
             axios
            .post("TPositionMessage/updateTPositionMessage", this.formInline)
            .then((res) => {
                if (res.data.code == 200) {
                this.$message({
                    message: "恭喜你，" + res.data.msg,
                    type: "success",
                });
                this.resetQuery();
                } else {
                this.$message.error("错了哦，" + res.data.msg);
                }
            });

        }
        
        },
        //回显审批列表
        findById(){
            axios
            .get("TPositionMessage/findPositionMessageById?id=" + this.$route.query.id)
            .then((res) => {
               this.formInline = res.data;
               this.formInline.tposition.postType=res.data.tposition.postType+"";
               this.formInline.educational=res.data.educational+"";
               this.formInline.workExperience=res.data.workExperience+"";
               this.formInline.sex=res.data.sex+"";
               this.formInline.age=res.data.age+"";
               console.log(res.data);
                axios
                .get("demo/findOneUser?id=" + this.formInline.principal)
                .then((res) => {
                 this.selectedUser = res.data;
                });
                axios
                .get("demo/findOneUser?id=" + this.formInline.manager)
                .then((res) => {
                 this.selectedUser2 = res.data;
                });
                axios
                .get("demo/findOneUser?id=" + this.formInline.preliminary)
                .then((res) => {
                 this.selectedUser3 = res.data;
                });
                axios
                .get("TPositionMessage/findInterviewRound?id=" + this.$route.query.id)
                .then((res) => {
                    this.tinterviewRoundPO.conferenceRoom1=res.data[0].conferenceRoom;
                    this.tinterviewRoundPO.conferenceRoom2=res.data[1].conferenceRoom;
                    axios
                    .get("demo/findOneUser?id=" + res.data[0].interviewer)
                    .then((res) => {
                    this.selectedUser4 = res.data;
                    });
                    axios
                    .get("demo/findOneUser?id=" + res.data[1].interviewer)
                    .then((res) => {
                    this.selectedUser5 = res.data;
                    });
                });
            });
            
        },
        // 负责人start
        // 更新步骤条
        upNav(index) {
            this.headNavs = this.headNavs.slice(0, index + 1);
            if ("组织架构" == this.headNavs) {
                this.loading = true;
                this.users = [];
                this.getDept();
            }
        },
        // 获取部门及部门人数
        getDept() {
            this.selectId = -1;
            axios.post("/ReplacementCard/findDept")
                .then((res) => {
                    this.persons = res.data.rows;
                    this.loading = false;
                })
        },
        // 获取所选择部门的用户信息
        selectArchitecture(value) {
            this.loading = true;
            this.persons = [];
            this.headNavs.push(value);
            var data = new FormData();
            data.append("name", value)
            axios.post("/ReplacementCard/findUserAndDept", data)
                .then((res) => {
                    this.users = res.data.rows;
                    if (this.users != []) {
                        this.loading = false;
                    }
                })

        },
        // 选中用户 招聘负责人
        selectUser(index) {
            this.selectArchitectureCss = index;
            this.selectedUser = this.users[index];
            this.formInline.principal = this.selectedUser.id;
        },
        // 删除用户
        deUser() {
            this.selectId = -1;
            this.selectedUser = "";
            this.selectArchitectureCss = -1;
            this.formInline.principal = "";
        },
         //用人经理
        selectUser2(index){
            this.selectArchitectureCss = index;
            this.selectedUser2 = this.users[index];
            this.formInline.manager = this.selectedUser2.id;
        },
        deUser2(){
            this.selectId=-1;
            this.selectedUser2="";
            this.selectArchitectureCss = -1;
            this.formInline.manager = "";
        },
         //简历初筛人
        selectUser3(index){
            this.selectArchitectureCss = index;
            this.selectedUser3 = this.users[index];
            this.formInline.preliminary = this.selectedUser3.id;
        },
        deUser3(){
            this.selectId=-1;
            this.selectedUser3="";
            this.selectArchitectureCss = -1;
            this.formInline.preliminary = "";
        },
        //第一轮面试官
        selectUser4(index){
            this.selectArchitectureCss = index;
            this.selectedUser4 = this.users[index];
            this.tinterviewRoundPO.interviewer1 = this.selectedUser4.id;
        },
        deUser4(){
            this.selectId=-1;
            this.selectedUser4="";
            this.selectArchitectureCss = -1;
            this.tinterviewRoundPO.interviewer1 = "";
        },
        //第二轮面试官
         selectUser5(index){
            this.selectArchitectureCss = index;
            this.selectedUser5 = this.users[index];
            this.tinterviewRoundPO.interviewer2 = this.selectedUser5.id;
        },
        deUser5(){
            this.selectId=-1;
            this.selectedUser5="";
            this.selectArchitectureCss = -1;
            this.tinterviewRoundPO.interviewer2 = "";
        },
        // 负责人end
        resetQuery(){
            this.formInline.startupDate="";
            this.formInline.latestDate="";
            this.formInline.tposition.positionName="";
            this.formInline.tposition.postType="";
            this.formInline.tposition.deptName="";
            this.selectedUser="";
            this.selectedUser2="";
            this.selectedUser3="";
            this.selectedUser4="";
            this.selectedUser5="";
            this.tinterviewRoundPO.conferenceRoom1="";
            this.tinterviewRoundPO.conferenceRoom2="";
            this.formInline.sex="";
            this.formInline.educational="";
            this.formInline.workExperience="";
            this.formInline.age="";
        }
    }

}
</script>

<style scoped>
.el-row {
    margin-bottom: 20px;
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: white;
    height: 1150px;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
    
  }
  .kuang{
        width: 4.5px;
        height: 25px;
        background-color: #409EFF;
        margin-left: 30px;
        position: relative;
        top: 23px;
    }
    .xian{
        width: 1200px;
        height: 2px;
        background-color: #EBEEF5;
        margin-left: 40px;
        margin-top: 15px;
       
    }
     /* 获取负责人start */
    .architecture{
        width: 271px;
        height: 39px;
        padding-left: 20px;
        border-radius: 5px;
    }
    .architecture:hover{
        background-color: #f8f8f8;
    }
    .architectureActe{
        width: 271px;
        height: 39px;
        line-height: 39px;
        padding-left: 20px;
        border-radius: 5px;
        background-color: rgba(231, 244, 255, 1);;
    }
    /* 竖着的水平线 */
    .myHr{
        border-left: 2px solid#989DAA;;
        height:100%;
        left: 48%;
        top: 0px;
        position: absolute;
    }

    .log{
        width: 27px;
        height: 27px;
        background-color: rgba(158, 208, 255, 1);
        float: left;
        position: relative;
        top: 15%;
        border-radius: 50%;
    }
    .log img{
        width: 13px;
        height: 13px;
        position: relative;
        bottom: 15%;
        left: 25%;
    }
    .avatar-uploader-icon[data-v-0c7ffabc]{
        border: 1px solid rgba(198, 201, 208, 1);
        background-color: rgba(248, 248, 248, 1);
        border-radius: 50%;
    }
    .avatar-uploader-icon {
        font-size: 20px;
        color: #8c939d;
        width: 50px;
        height: 50px;
        line-height: 50px;
        text-align: center;
    }
    /* 获取负责人end */
 
</style>